package written_test;

import java.util.*;

/**
 * @author zhx
 * @since 2020-09-07
 */
public class Shell {
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        int T = in.nextInt();
        for (int i = 0; i < T; i++) {
            String[] arr = new String[4];
            for (int i1 = 0; i1 < 4; i1++) {
                arr[i1] = in.next();
            }
            calc(arr);
        }
        in.close();

    }

    public static void calc(String[] arr) {
        String[] nm = new String[]{arr[0], arr[1]};
        String[] nn = new String[]{arr[2], arr[3]};
        int leftWin = 0;
        int rightWin = 0;
        leftWin += a(nm[0], nn[1]);
        leftWin += a(nm[0], nn[0]);
        rightWin += a(nm[1], nn[0]);
        rightWin += a(nm[1], nn[1]);
        if (leftWin > rightWin) {
            System.out.println("left");
        }
        if (leftWin == rightWin) {
            System.out.println("same");
        }
        if (leftWin < rightWin) {
            System.out.println("right");
        }

    }

    public static int a(String a, String b) {
        if ("J".equals(a) && "B".equals(b)) {
            return 1;
        } else if ("B".equals(a) && "S".equals(b)) {
            return 1;
        } else if ("S".equals(a) && "J".equals(b)) {
            return 1;
        } else {
            return 0;
        }
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] a = new int[2 * n];
        int[] b = new int[2 * n];
        for (int i = 0; i < 2 * n; i++) {
            a[i] = in.nextInt();
        }
        for (int i = 0; i < 2 * n; i++) {
            b[i] = in.nextInt();
        }

        int[] rev = new int[2 * n];
        for (int i = 0; i < 2 * n; i++) {
            rev[i] = b[i] - a[i];
        }

        int left = n - 1;
        int right = n;
        boolean leftFlag = true;
        boolean rightFlag = true;
        List<Integer> rec = new ArrayList<>();
        int life = 0;
        while (leftFlag || rightFlag) {
            int left_tmp = 0;
            int right_tmp = 0;
            if (leftFlag) {
                left_tmp = rev[left];
            } else {
                left_tmp = Integer.MIN_VALUE;
            }
            if (rightFlag) {
                right_tmp = rev[right];
            } else {
                right_tmp = Integer.MIN_VALUE;
            }
            if (left_tmp > right_tmp) {
                life += rev[left];
                rec.add(life);
                if (left > 0) {
                    left--;
                } else {
                    leftFlag = false;
                }

            } else {
                life += rev[right];
                rec.add(life);
                if (right < 2 * n - 1) {
                    right++;
                } else {
                    rightFlag = false;
                }
            }
        }
        Collections.sort(rec);
        int min = rec.get(0);
        System.out.println(Math.abs(min) + 1);

    }
}
